/**
 * Copyright (c) 2009, http://www.softwareinlife.com. All rights reserved.
 * 
 * Redistribution and use in source and binary forms, 
 * with or without modification, are permitted provided that 
 * the following conditions are met:
 * 
 * 1. Redistributions of source code must retain the above copyright notice, 
 *    this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright notice, 
 *    this list of conditions and the following disclaimer in the documentation 
 *    and/or other materials provided with the distribution.
 * 
 * 3. Neither the name of the http://www.softwareinlife.com nor the names of its 
 *    contributors may be used to endorse or promote products derived from 
 *    this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE SOFTWAREINLIFE AND CONTRIBUTORS "AS IS" 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package com.softwareinlife.vision.android.system.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Base Model
 * 
 * @author Jang, Sun-Jin(jangsunjin@softwareinlife.com)
 * @date 2009. 10. 10.
 */
public class BaseModel implements Serializable {

	/**
	 * Serial Version UID
	 */
	private static final long serialVersionUID = 1L;

	public static final String ATTR_ACTION = "a";
	
	public static final String CREATE = "C";
	public static final String UPDATE = "U";
	public static final String DELETE = "D";
	
	/**
	 * IDs
	 */
	protected int ids = 0;
	
	protected int clientId = 0;

	/**
	 * Created Date
	 */
	protected Date createdDate = null;

	/**
	 * Modified Date
	 */
	protected Date modifiedDate = null;

	/**
	 * Sync Date
	 */
	protected Date syncDate = null;
	
	protected String action = null;
	
	protected List<BaseModel> m_models = new ArrayList<BaseModel>();

	/**
	 * Constructor
	 */
	public BaseModel() {
		super();
	}


	/**
	 * @return the createdDate
	 */
	public Date getCreatedDate() {
		return createdDate;
	}

	/**
	 * @param createdDate
	 *            the createdDate to set
	 */
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	/**
	 * @return the modifiedDate
	 */
	public Date getModifiedDate() {
		return modifiedDate;
	}

	/**
	 * @param modifiedDate
	 *            the modifiedDate to set
	 */
	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	/**
	 * @return the ids
	 */
	public int getIds() {
		return ids;
	}

	/**
	 * @param ids
	 *            the ids to set
	 */
	public void setIds(int ids) {
		this.ids = ids;
	}
	
	public int getClientId() {
		return clientId;
	}
	
	public void setClientId(int arg_clientId) {
		clientId = arg_clientId;
	}

	/**
	 * @return the syncDate
	 */
	public Date getSyncDate() {
		return syncDate;
	}

	/**
	 * @param syncDate
	 *            the syncDate to set
	 */
	public void setSyncDate(Date syncDate) {
		this.syncDate = syncDate;
	}
	
	/**
	 * 
	 * @return
	 */
	public String getAction() {
		return action;
	}
	
	/**
	 * 
	 * @param arg_action
	 */
	public void setAction(String arg_action) {
		action = arg_action;
	}
	
	/**
	 * 
	 * @param arg_model
	 */
	public void AddModel(BaseModel arg_model) 
	{
		m_models.add(arg_model);
	}
	
//	/**
//	 * 
//	 * @return
//	 */
//	public BaseModel GetModel(int arg_location) 
//	{
//		return m_models.get(arg_location);
//	}
//	
//	public int GetSize()
//	{
//		return m_models.size();
//	}
}
